<template>
	<view class="share-wrapper">
		<top-nav title="接收"></top-nav>
		<view class="content">
			<view class="code">
				<view class="info">AGT</view>
				<view class="icon1"></view>
			</view>
			<view class="qrcode">
				<u-image width="570rpx" height="570rpx" :src="qrcode"></u-image>
			</view>
			<view class="code">
				<view class="info">skdviriy098765sssxx</view>
				<view class="icon" @click="copy()"></view>
			</view>
		</view>
		<view class="btn-wrapper">
			<view class="share">分享地址</view>
		</view>
		<view class="desc">注意：改地址仅支持AGT收款，请勿用于其他币种！</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	import topNav from 'components/top-nav/top-vue.vue';
	import uniCopy from '@/js_sdk/xb-copy/uni-copy.js'
	export default{
		data(){
			return {
				qrcode:''
			}
		},
		components:{
			topNav:topNav
		},
		methods:{
			previewImage(){
				this.$refs.uToast.show({
					title: '点击了图片预览',
					type: 'success',
				})
				var imgArr = [];
				//预览图片
				uni.previewImage({
					urls: imgArr,
					current: imgArr[0]
				});

			},
			gotoPage(path){
				uni.redirectTo({
				    url: path
				});
			},
			copy(){
				 uniCopy({
					content:'这个是复制的内容',
					success:(res)=>{
						uni.showToast({
							title: res,
							icon: 'none'
						})
					},
					error:(e)=>{
						uni.showToast({
							title: e,
							icon: 'none',
							duration:3000,
						})
					}
				})
			},
			gotoRule(path){
				uni.navigateTo({
				    url: '/pages/rule/rule'
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.share-wrapper{
		.content{
			.u-image{
				margin: 0 auto;
			}
			.code{
				margin:32*2rpx auto 20*2rpx;
				width: 570rpx;
				height: 40*2rpx;
				background: rgba(105, 218, 115, 0.1);
				border-radius: 40rpx;
				border: 1px solid #69DA73;
				display:flex;
				align-items: center;
				justify-content: center;
				position:relative;
				font-size:14*2rpx;
				color:#CCCCCC;
				.icon{
					position:absolute;
					width: 15*2rpx;
					height:19*2rpx;
					background-image: url('/static/share/icon.png');
					background-size: 100% 100%;
					right:32*2rpx;
					top:50%;
					margin-top:-19rpx;
				}
				.icon1{
					width: 0;
					height: 0;
					border-left: 10rpx solid transparent;
					border-top: 12rpx solid #FFFFFF;
					border-right:10rpx solid transparent;
					position:absolute;
					right:62*2rpx;
				}
			}
		}
		.btn-wrapper{
			padding:0 20*2rpx;
			display: flex;
			justify-content: space-between;
			.share{
				width: 100%;
				height: 60*2rpx;
				background: #FFB721;
				border-radius: 3*2rpx;
				display: flex;
				align-items: center;
				font-size:19*2rpx;
				justify-content: center;
			}
		}
		.desc{
			margin:34*2rpx auto 28*2rpx;
			text-align: center;
			opacity: 0.3;
		}
	}
</style>
